home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / eflibpt4.zip / DEMO / MISC / TIMER.PAS < prev   
Pascal/Delphi Source File  |  1996-08-15  |  946b  |  33 lines

  1. { Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
  2.   Demonstration; high-precision timing
  3.  
  4.   EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
  5.   MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
  6.   ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED.                          }
  7.  
  8.  
  9. uses EFLIBDEF, EFLIBINI, EFLIBBAS, CRT;
  10.  
  11. var Timer   : TimerObjectType;
  12.     Elapsed : real;
  13.  
  14.  
  15. begin
  16.      WriteLn ('* High-precision timer and Pascal delay comparison *');
  17.  
  18.      Timer.Initialize;
  19.  
  20.      { CRT delay }
  21.      Timer.Reset;
  22.      Delay (2000);
  23.      Elapsed := Timer.ElapsedMS;
  24.      WriteLn ('Borland Pascal delay took ', Elapsed:0:6, ' [ms] for a 2000 millesecond-delay');
  25.  
  26.      { EFLIB delay }
  27.      Timer.Reset;
  28.      Timer.Delay (2000);
  29.      Elapsed := Timer.ElapsedMS;
  30.      WriteLn ('EFLIB delay actually took ', Elapsed:0:6, ' [ms]');
  31.  
  32.      Timer.Intercept;
  33. end.